package com.example.note2;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by 居伦昶 on 2018/6/21.
 */

public class NotesDB extends SQLiteOpenHelper {
    public static final String TABLE_NAME="notes";
    public static final String CONTENE="content";
    public static final String ID="_id";
    public static final String TIME="time";
    public NotesDB(Context context) {
        super(context, "notes", null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table notes("
                + " _id integer primary key autoincrement,"
                + " content text not null,"
                + " time text not null)"
        );//创建数据库
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
